﻿/*
 
Celerity: Sensory Overload
Copright 2012 by Adam Hill, David Gannon, Thomas Tamblyn & Patrick Ytting
Contact: adam.hill@outlook.com
Website: adamhill.org
Licence: MS-Pl Licence
  
 */

using Celerity.ColourPalette;
using Celerity.Content;
using Celerity.Data;
using Celerity.Entities;
using Microsoft.Xna.Framework;
using System.Collections.Generic;

namespace Celerity.UI.Definition.Controls
{
    public class IconMuteControl : UIEntity
    {
        public override void ConfigureSelf()
        {
            IsPressable = true;
            Items = new List<UIEntityItem>
                    {
                        new UIEntityItem // Background
                        {
                            Size = this.Size,
                            Offset = this.Offset,
                            ImageDefault = ImageLibrary.TextureGrey,
                            ImagePressed = ImageLibrary.TextureGrey,
                        },
                        new UIEntityItem // Mute icon
                        {
                            Size = this.Size + new Vector2(-20, -40),
                            Offset = this.Offset + new Vector2(10, 0),
                            ImageDefault = ImageLibrary.IconMuteMute,
                            ImagePressed = ImageLibrary.IconMuteMutePressed,
                            DrawCondition = new UIDrawCondition
                            {
                                CheckMuteState = true,
                                CheckedMuteStates = new List<MuteState>
                                {
                                    MuteState.NotMuted
                                }
                            }
                        },
                        new UIEntityItem // Mute Text
                        {
                            Size = this.Size,
                            Offset = this.Offset + UIGeometry.IconTextOffset,
                            Font = FontLibrary.Standard,
                            FontColorDefault = Palette.Black,
                            FontColorPressed = Palette.Accent,
                            Text = ResxText.Mute,
                            ApplyCentring = true,
                            DrawCondition = new UIDrawCondition
                            {
                                CheckMuteState = true,
                                CheckedMuteStates = new List<MuteState>
                                {
                                    MuteState.NotMuted
                                }
                            }
                        },
                        new UIEntityItem // Unmute icon
                        {
                            Size = this.Size + new Vector2(-20, -40),
                            Offset = this.Offset + new Vector2(10, 0),
                            ImageDefault = ImageLibrary.IconMuteUnmute,
                            ImagePressed = ImageLibrary.IconMuteUnmutePressed,
                            DrawCondition = new UIDrawCondition
                            {
                                CheckMuteState = true,
                                CheckedMuteStates = new List<MuteState>
                                {
                                    MuteState.Muted
                                }
                            }
                        },
                        new UIEntityItem // Unmute Text
                        {
                            Size = this.Size,
                            Offset = this.Offset + UIGeometry.IconTextOffset,
                            Font = FontLibrary.Standard,
                            FontColorDefault = Palette.Black,
                            FontColorPressed = Palette.Accent,
                            Text = ResxText.Unmute,
                            ApplyCentring = true,
                            DrawCondition = new UIDrawCondition
                            {
                                CheckMuteState = true,
                                CheckedMuteStates = new List<MuteState>
                                {
                                    MuteState.Muted
                                }
                            }
                        },
                    };
        }
    }
}
